es6 use destructuring assignment to pass an object as a functions parameters